{% extends "site_base.html" %}

{% load i18n %}
{% load uni_form %}

{% block head_title %}{% trans "Signup" %}{% endblock %}

{% block body %}
    <h1>{% trans "Sign Up" %}</h1>
    
    {% if user.is_authenticated %}
        <p>{% trans "You are already logged in." %}</p>
    {% else %}
        <p>{% trans "Already have an account?" %} <a href="{% url acct_login %}">{% trans "Log In" %}</a>!</p>
        
        <form class="signup uniForm" id="signup_form" method="post" action="{% url acct_signup %}">
            <fieldset class="inlineLabels">
                {{ form|as_uni_form }}
                <div  class="form_blick">
                    <input type="submit" value="{% trans "Sign Up &raquo;" %}" />
                </div>
            </fieldset>
        </form>
        
        {% url terms as terms_url %}
        {% url privacy as privacy_url %}
        <p>{% blocktrans %}By clicking "Sign Up", you are indicating that you have read and agree to the <a href="{{ terms_url }}">Terms of Use</a> and <a href="{{ privacy_url }}">Privacy Policy</a>.{% endblocktrans %}</p>
        
        <p>{% blocktrans %}If you have any trouble creating your account, contact us at <a href="mailto:{{ CONTACT_EMAIL }}">{{ CONTACT_EMAIL }}</a>.{% endblocktrans %}</p>
        
        {# @@@ currently OpenID signup is not supported via signup codes #}
        {% if not code %}
            <p>If you have OpenID, <a href="{% url acct_login %}">log in</a> using that to begin using this site with OpenID right away.</p>
        {% endif %}
    {% endif %}
{% endblock %}

{% block extra_body %}
    {% load jquery_validation %}
    {% include_validation %}
    <script type="text/javascript">
        $(function(){
            $('#signup_form').validate('{% url signup_form_validate %}', {type: 'table', fields: ['username'], dom: $('#id_username'), event: 'change'});
            $("#id_username").focus();
        });
    </script>
{% endblock %}